#define WM_THEMECHANGED 0x031A /* winxp only */\r
#endif\r
\r
+static GModule * this_module = NULL;\r
+static void (*msw_reset_rc_styles) (GtkSettings * settings) = NULL;\r
+\r
/* TODO - look into whether we need to handle these:\r
*\r
* WM_STYLECHANGED\r
\r
switch (msg->message)\r
{\r
-#if ENABLE_THEME_CHANGING\r
+ /* We need to do something better than this check - if a theme builder has GTK 2.4.x\r
+ but the user has 2.2.x, he/she will run into trouble wrt unresolved symbols */\r
+\r
/* catch theme changes */\r
case WM_THEMECHANGED:\r
case WM_SYSCOLORCHANGE:\r
- xp_theme_reset ();\r
- msw_style_init ();\r
\r
- /* force all gtkwidgets to redraw */\r
- gtk_rc_reparse_all_for_settings (gtk_settings_get_default(), TRUE);\r
+ if(msw_reset_rc_styles != NULL) {\r
+ xp_theme_reset ();\r
+ msw_style_init ();\r
+\r
+ /* force all gtkwidgets to redraw */\r
+ (*msw_reset_rc_styles) (gtk_settings_get_default());\r
+ }\r
+\r
return GDK_FILTER_REMOVE;\r
-#endif\r
\r
case WM_SETTINGCHANGE:\r
/* catch cursor blink, etc... changes */\r
- msw_style_setup_system_settings (); \r
+ msw_style_setup_system_settings ();\r
return GDK_FILTER_REMOVE;\r
\r
default:\r
{\r
msw_rc_style_register_type (module);\r
msw_style_register_type (module);\r
+\r
+ /* this craziness is required because only gtk 2.4.x and later have\r
+ gtk_rc_reset_styles(). But we want to be able to run acceptly well\r
+ on any GTK 2.x.x platform. */\r
+ if(gtk_check_version(2,4,0) == NULL) {\r
+ /* dlopen(this) */\r
+ this_module = g_module_open(NULL, 0);\r
+\r
+ if(this_module)\r
+ g_module_symbol (this_module, "gtk_rc_reset_styles",\r
+ (gpointer *)(&msw_reset_rc_styles));\r
+ }\r
+\r
msw_style_init ();\r
gdk_window_add_filter (NULL, global_filter_func, NULL);\r
}\r
theme_exit (void)\r
{\r
gdk_window_remove_filter (NULL, global_filter_func, NULL);\r
+\r
+ if(this_module) {\r
+ g_module_close(this_module);\r
+ this_module = NULL;\r
+ }\r
}\r
\r
G_MODULE_EXPORT GtkRcStyle *\r